<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>留言列表</h2> 
		<!--
		<h2 style="margin-left:20px;">未回复：<span style="color: red;">{$MessagesCounts}</span></h2>
		-->
	</div>
	<div class="cf">
		<div class="fl">
            <button class="btn ajax-post" url="{:U('Messages/changeStatus',array('method'=>'resumeUser'))}" target-form="ids">启 用</button>
            <button class="btn ajax-post confirm" url="{:U('Messages/del',array('method'=>'deleteUser'))}" target-form="ids">删 除</button>
        </div>

        <!-- 高级搜索 -->
		<div class="search-form fr cf">

		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">序号</th>
		<th class="">姓名</th>
		<th class="">电话</th>
		<th class="">邮箱</th>
		<th class="">留言内容</th>
		<th class="">留言时间</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="list">
		<volist name="list" id="vo" key="n">
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
			<td>{$n} </td>
			<td>{$vo.name}</td>
			<td>{$vo.mobile}</td>
			<td>{$vo.email}</td>
			<td>{$vo.content|cutstr=0,20}</td>
			<td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
			
			<td>
                <a href="{:U('Messages/edit?id='.$vo['id'].'&ksid='.$vo['ksid'])}">查看</a>
				<a href="{:U('Messages/del?id='.$vo['id'])}" class="confirm ajax-get">删除</a>
                </td>
		</tr>
		</volist>
		<else/>
		<td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
	
	<!-- ajax提交排序 --->
    <script>
	    $(function(){
		      $("input[name='sort']").change(function(){
			      sort = $(this).val();
			      id = $(this).attr("data-id");
				  $.post("{:U('Messages/ajaxsort')}",{sort:sort,id:id},function(d){
				  
				       alert(d.msg);
				  });
			  
			  });
		});
	
	</script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		

		var typeid = $("select[name=typeid]").val();
        var title  = $('input[name=title]').val();
        $("#form1").submit();

		
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			
			$("#search").click();
			return false;
			
		}
	});
	
    //导航高亮
    highlight_subnav('{:U('Messages/index')}');
	</script>
</block>
